#!/usr/bin/env jruby
# -*- ruby -*-
#. hashdot.profile         += daemon
#. hashdot.pid_file         = ./rjack-solr.pid
#. hashdot.io_redirect.file = ./rjack-solr.log
#. hashdot.vm.options += -Xmx1g
#. hashdot.vm.options += -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled

#--
# Copyright (c) 2012-2016 David Kellum
#
# Licensed under the Apache License, Version 2.0 (the "License"); you
# may not use this file except in compliance with the License.  You
# may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.  See the License for the specific language governing
# permissions and limitations under the License.
#++

require 'rubygems'
gem( "rjack-solr", "= 4.3.1.0" )

module BinScript

  require 'rjack-logback'
  include RJack
  Logback.config_console( :full => true, :thread => true )
  Logback[ 'org.apache.solr' ].level = :warn

  require 'rjack-solr/server'

  Hooker.log_with { |m| SLF4J[ 'rjack.solr' ].info( m.rstrip ) }
  Hooker.load_file( './config.rb' ) if File.exist?( './config.rb' )

  server = Solr::Server.new
  server.start
  server.join

end
